<template>
	<view class="awardItem">
		<view class="userinfo">
			<image class="pic" src="../../static/images/logo.jpg" mode="aspectFill"></image>
			<view class="text">
				匿名
			</view>
		</view>
		<view class="body">
			<view class="left">
				<image src="../../static/images/logo.jpg" mode="aspectFill"></image>
			</view>
			<view class="right">
				<view class="title">
					一等奖
				</view>
				<view class="info">
					<view class="line">
						奖品：123
					</view>
					<view class="line">
						轮次：第一轮中奖
					</view>
					<view class="line">
						中奖时间：2024-05-09
					</view>
					<view class="line">
						<button type="primary" size="mini" v-if="code" @click="clickGiveCode">兑换码</button>
						<button type="primary" size="mini" v-if="writeoff" @click="clickWriteOff">手动核销</button>
					</view>
				</view>
			</view>
		</view>
		<view class="confirm" v-if="confirm">
			<button type="primary">确认核销</button>
		</view>
	</view>
</template>

<script setup>
	defineProps({
		writeoff: {
			type: Boolean,
			default: false
		},
		code: {
			type: Boolean,
			default: false
		},
		confirm: {
			type: Boolean,
			default: false
		}
	})

	const clickWriteOff = () => {
		console.log("点击核销")
	}

	const clickGiveCode = () => {
		console.log("点击兑换码")
	}
</script>

<style lang="scss" scoped>
	.awardItem {
		border: 1px solid #eee;
		border-radius: 10rpx;
		border-bottom-width: 3px;

		.userinfo {
			height: 80rpx;
			background: #eee;
			display: flex;
			align-items: center;
			padding: 0 30rpx;

			.pic {
				width: 60rpx;
				height: 60rpx;
				border: 1px solid #fff;
				border-radius: 50%;
			}

			.text {
				font-size: 32rpx;
				font-weight: bolder;
				margin-left: 15rpx;
			}
		}

		.body {
			padding: 30rpx;
			display: flex;

			.left {
				width: 230rpx;
				height: 230rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.right {
				flex: 1;
				padding-left: 20rpx;

				.title {
					font-size: 38rpx;
					font-weight: bolder;
				}

				.info {
					margin-top: 10rpx;
					font-size: 28rpx;
					color: #666;
					line-height: 1.5rem;

					.line {
						padding-bottom: 4rpx;
					}
				}
			}
		}

		.confirm {
			padding: 20rpx 0;
			padding-top: 60rpx;
		}
	}
</style>